﻿<UserControl xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:data="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             x:Class="SoftSource.Timecard.Views.EntriesFlaggedForAdminView"
             mc:Ignorable="d"
             d:DesignWidth="572"
             d:DesignHeight="413">
    <UserControl.Resources>
        <DataTemplate x:Key="EntryDetailsTemplate">
            <Grid d:DesignWidth="557"
                  d:DesignHeight="53">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition />
                </Grid.ColumnDefinitions>
                <Grid Grid.Column="1"
                      Margin="4">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                        <RowDefinition />
                    </Grid.RowDefinitions>
                    <TextBlock Text="Description:"
                               TextWrapping="Wrap"
                               d:LayoutOverrides="Width, Height"
                               Margin="0,0,0,3" />
                    <TextBox TextWrapping="Wrap"
                             d:LayoutOverrides="Height"
                             Grid.Row="1"
                             IsReadOnly="True"
                             Text="{Binding Description, Mode=OneWay}"
                             MaxHeight="150"
                             HorizontalScrollBarVisibility="Auto"
                             ScrollViewer.HorizontalScrollBarVisibility="Auto"
                             ScrollViewer.VerticalScrollBarVisibility="Auto"
                             VerticalScrollBarVisibility="Auto" />
                </Grid>
                <StackPanel VerticalAlignment="Center"
                            Margin="4">
                    <StackPanel Margin="2"
                                Orientation="Horizontal"
                                d:LayoutOverrides="Width">
                        <TextBlock VerticalAlignment="Center"
                                   Text="Hours:"
                                   TextWrapping="Wrap" />
                        <TextBlock Margin="3,0,0,0"
                                   VerticalAlignment="Center"
                                   Text="{Binding Duration, Mode=OneWay}"
                                   TextWrapping="Wrap" />
                    </StackPanel>
                    <CheckBox Content="Overnight"
                              d:LayoutOverrides="Width"
                              IsChecked="{Binding OvernightStay, Mode=OneWay}"
                              Margin="2"
                              IsEnabled="False" />
                </StackPanel>
            </Grid>
        </DataTemplate>
    </UserControl.Resources>
    <Grid x:Name="LayoutRoot">
        <data:DataGrid x:Name="EntryGrid"
                       AutoGenerateColumns="False"
                       IsReadOnly="True"
                       ItemsSource="{Binding Entries}"
                       RowDetailsTemplate="{StaticResource EntryDetailsTemplate}">
            <data:DataGrid.Columns>
                <data:DataGridTextColumn Header="Project"
                                         Binding="{Binding ProjectID, Converter={StaticResource ProjectIDConverter}, ConverterParameter=Name}" />
                <data:DataGridTextColumn Header="Name"
                                         Binding="{Binding UserID, Converter={StaticResource UserIDConverter}, ConverterParameter=FullName}" />
                <data:DataGridTextColumn Header="Entry Date"
                                         Binding="{Binding EntryDate, Converter={StaticResource FormattedDateConverter}}" />
                <data:DataGridTextColumn Header="Reason"
                                         Binding="{Binding HoursAdjustmentReason}" />
            </data:DataGrid.Columns>
        </data:DataGrid>
    </Grid>
</UserControl>
